import request from "@/utils/request";

// 发送手机验证码，但是弹框提示
export const sendsms = (data) => {
  return request({
    url: "/sendsms",
    method: "post",
    data,
  });
};
// 生成注册页面的图形验证码
export const regCode = () => {
  return request({
    url: "/captcha?type=sendsms",
    responseType: "arraybuffer",
  });
};

// 注册接口
export const register = (data) => {
  return request({
    url: "/register",
    method: "post",
    data,
  });
};
// 题库上传文件，他的接口不完善，要上传到它的服务器，也可以上传头像
export const questionUpload = (data) => {
  return request({
    url: "/question/upload",
    method: "post",
    data: data,
  });
};

// 注册时上传用户头像
export const uploadAvatar = (data) => {
  return request({
    url: "/uploads",
    method: "post",
    data: data,
  });
};
